#include <iostream>
#include <fstream>
using namespace std;
void log();
template <typename T, typename... Types>
void log(const T& firstArg, const Types&... args){
//    cout <<"write log.txt" <<endl;
    ofstream  ouf;
    ouf.open("../log.txt",ios::app);
    ouf << __TIME__;
    ouf << firstArg;
//    log(args...);
    ouf.close();
}
// version1
void print1() {};

template <typename T, typename... Types>
void print1(const T& firstArg, const Types&... args)
{
    cout << firstArg << endl;
    print1(args...);
}



template < typename T , typename ... Types>
void print2 (const T& firstArg , const Types&... args)
{

    cout << firstArg ;
    if constexpr ( sizeof ...(args) > 0) print2 (args...) ;

}

template < typename T , typename ... Types>
void print3 (const T& firstArg , const Types&... args)
{
//
    cout << firstArg << endl ;
    initializer_list <T> { ( [&args] {cout << args << endl;}(), firstArg )...};
}
template < typename T , typename ... Types>
void prin3_test (const T& firstArg , const Types&... args)
{
    cout << firstArg << endl ;
    auto i_l = initializer_list <T> { ( [&args] {cout << args << endl;}(), firstArg )...};
    for (auto i : i_l)
        cout << i << endl;
}



template <typename ... Types>
void print4 (const Types&... args)
{

    cout << "["<<__TIME__<<"]";
    log("","]");
    initializer_list <int> { ([&args] {
        log(args);
        cout << args ;
    }(), 0)...};

    cout << "[end]" ;
    log("\n");
}

int main() {
    print4("aaaa",1234);
    return 0;
}
